/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gov.police.diary.dao.impl;

import gov.police.diary.dao.CustomHibernateDaoSupport;
import gov.police.diary.dao.PolicemanDao;
import gov.police.diary.model.PolPoliceman;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author nmduc
 */
@Repository("PolicemanDao")
@Transactional
public class PolicemanDaoImpl extends CustomHibernateDaoSupport implements PolicemanDao {

    public PolPoliceman getPoliceman(long id) {
        return getHibernateTemplate().get(PolPoliceman.class, id);
    }

    public void savePoliceman(PolPoliceman policeman) {
        getHibernateTemplate().save(policeman);
    }

    public void deletePoliceman(PolPoliceman policeman) {
        getHibernateTemplate().delete(policeman);
    }

    public void updatePoliceman(PolPoliceman policeman) {
        getHibernateTemplate().update(policeman);
    }

}
